package com.enation.app.shop.front.policyInsurance.service.impl;

import com.enation.app.base.core.model.Member;
import com.enation.app.shop.front.policyInsurance.service.InsuranceManageMapper;
import com.enation.framework.database.IDaoSupport;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class InsuranceMemberService implements InsuranceManageMapper {
    @Autowired
    private IDaoSupport iDaoSupport;


    @Override
    public List<Member> getAllInsuranceMember(Integer page,Integer limit,String name) {
        String sql =" SELECT * from es_member s where s.member_type=2";
        if(name!=null){
            sql += " and s.uname like '%"+name+"%'";
        }
            sql += " order by s.member_id asc  limit ?,?";
        return iDaoSupport.queryForList(sql,Member.class,page,limit,name);
    }
}
